package com.uzai.console.entity.es;

import com.uzai.common.utils.EsIndexName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

/**
 * @Auther: liuqu
 * @Date: 2021/11/19 11:33
 * @Description: 用户登录日记ES index
 */
@ApiModel("账号登录日志")
@Document(indexName = EsIndexName.UZAI_CONSOLE_USER_LOGIN_LOG, shards = 3, replicas = 2)
public class EsUserLoginLog implements Serializable {

    private static final long serialVersionUID = 5250981356679008728L;

    @ApiModelProperty("主键ID")
    @Id
    private String id;

    @Field(type = FieldType.Long)
    @ApiModelProperty("运营商ID")
    private Long merId;

    @ApiModelProperty("账号")
    @Field(type = FieldType.Keyword)
    private String account;

    @ApiModelProperty("登录IP")
    @Field(type = FieldType.Keyword)
    private String ip;

    @ApiModelProperty("国家")
    @Field(type = FieldType.Keyword)
    private String country;

    @ApiModelProperty("省份")
    @Field(type = FieldType.Keyword)
    private String province;

    @ApiModelProperty("市")
    @Field(type = FieldType.Keyword)
    private String city;

    @ApiModelProperty("区域")
    @Field(type = FieldType.Keyword)
    private String area;

    @ApiModelProperty("登录状态(0-登录失败;1-登录成功)")
    @Field(type = FieldType.Integer)
    private Integer loginStatus;

    @ApiModelProperty("登录结果")
    @Field(type = FieldType.Keyword)
    private String loginResult;

    @ApiModelProperty("登录时间")
    @Field(type = FieldType.Integer)
    private Integer loginTime;

    @ApiModelProperty("登录类型(登录类型（0-主账号登录；1-子账号登录；2-悠聊账号登录)")
    @Field(type = FieldType.Integer)
    private Integer type;

    @ApiModelProperty("登录token")
    @Field(type = FieldType.Keyword)
    private String loginToken;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Long getMerId() {
        return merId;
    }

    public void setMerId(Long merId) {
        this.merId = merId;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public Integer getLoginStatus() {
        return loginStatus;
    }

    public void setLoginStatus(Integer loginStatus) {
        this.loginStatus = loginStatus;
    }

    public String getLoginResult() {
        return loginResult;
    }

    public void setLoginResult(String loginResult) {
        this.loginResult = loginResult;
    }

    public Integer getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(Integer loginTime) {
        this.loginTime = loginTime;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getLoginToken() {
        return loginToken;
    }

    public void setLoginToken(String loginToken) {
        this.loginToken = loginToken;
    }
}
